<div style="margin: 10px">


    <div class="col-xs-12">

        <form class="form-horizontal ajax-form" role="form" action="{:U('help/usercenter/evaluate')}"
              method="post"
              id="edit-article-form">
            <input type="hidden" name="help_id" value="{$help_id}"/>
            <input type="hidden" name="to_uid" value="{$to_uid}"/>
                <div class="col-sm-12 has-feedback" style="">
                    <div class="form-group ">
                        <div class="col-sm-12 pull-left">
                            <div class="pull-left" style="width: 100%">
                                <label>好评&nbsp;<input type="radio" value="1" name="type" checked></label>&nbsp;&nbsp;
                                <label>中评&nbsp;<input type="radio" value="2" name="type"></label>&nbsp;&nbsp;
                                <label>差评&nbsp;<input type="radio" value="3" name="type"></label>
                                <div style="width: 100%">
                                    {:W('Score/render',array('row_id'=>$unid))}
                                </div>

                            </div>
                            <div class="dashed pull-left" style="width: 100%;margin-bottom: 20px;"></div>

                            <textarea name="content" class="form-control" style="height: 100px;"></textarea>
                        </div>

                        <div class="col-sm-12">
                            <div>添加现场照</div>
                            <div class="pull-left publish_work_image_list" id="add_image" >
                                <input type="hidden" name="image" id="image_{$unid}">

                                <div class="img-list clearfix" style="padding-left: 14px;">
                                    <ul id="ul_{$unid}" style="-webkit-padding-start: 0px;">
                                        <li id="btn_{$unid}"><input style="display:none" id="uploadify_{$unid}"
                                                                    type="file"/></li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>
            <p class="col-xs-12" style="text-align: center">
                <button type="submit" class="btn btn-large btn-primary button_change" id="submit-button">
                            <span id="submit-content">
                                    发表评价
                            </span>
                </button>
            </p>
        </form>
    </div>
</div>


<script>
    var unid = "{$unid}",
    fileSizeLimit = "{$fileSizeLimit}"

    $('#uploadify_' + "{$unid}").uploadify({
        formData: {
            attach_type: 'feed_image',
            upload_type: 'image',
            thumb: 1,
            width: 100,
            height: 100,
            cut: 1,
            PHPSESSID: "<?php echo session_id(); ?>"
        },
        fileSizeLimit: fileSizeLimit,
        fileTypeDesc: 'Image Files',
        fileTypeExts: '*.jpg; *.png; *.gif;',
        swf: '__STATIC__/uploadify/uploadify.swf',
        uploader: "{:U('Home/File/uploadPicture',array('session_id'=>session_id()))}",
        width: 80,
        height: 80,
        buttonImage: '__ROOT__/Addons/InsertImage/_static/image/add-photo-multi.png',
        queueSizeLimit: 0,
        queueID: true,
        overrideEvents: ['onSelectError', 'onDialogClose'],
        onUploadSuccess: function (file, data, response) {
            var jsondata = $.parseJSON(data);
            multi_upload.removeLoading("{$unid}");
            if (jsondata.status === 1) {
                $('#btn_' + "{$unid}").before($('<li id="li_' + "{$unid}" + '_' + file.index + '"><img src="' + jsondata.path + '" width="80" height="80" /><a href="javascript:;" onclick="multi_upload.removeImage(\'' + "{$unid}" + '\', ' + file.index + ', ' + jsondata.id + ')"><span class="del">删除</span></a></li>').fadeIn('slow'));
            }
            multi_upload.upAttachVal('add', jsondata.id, "{$unid}");
        },
        onUploadStart: function (file) {
            multi_upload.addLoading("{$unid}");
        },
        onSelectError: function (file, errorCode, errorMsg) {
            switch (errorCode) {
                case -100:
                    toast.error('选择的上传数目超过，您还能上传' + errorMsg + '个图片');
                    break;
                case -110:
                    toast.error("文件 [" + file.name + "] 大小超出系统限制的" + $('#uploadify_' + "{$unid}").uploadify('settings', 'fileSizeLimit') + "大小", 4);
                    break;
                case -120:
                    toast.error("文件 [" + file.name + "] 大小异常");
                    break;
                case -130:
                    toast.error("文件 [" + file.name + "] 类型不正确");
                    break;
            }
        },
        onFallback: function () {
            toast.error('您未安装FLASH控件，无法上传！请安装FLASH控件后再试');
        }
    });
</script>